#include <stdio.h>
#include "man.h"
#include "boy.h"

static void man_bye(void);

G_DEFINE_TYPE(Man, man, BOY_TYPE);



void man_init(Man *man) {
	man->job = "none";
	man->bye = man_bye;
	puts("man init finished.");
}
void man_class_init(ManClass *cls) {
	puts("ManClass init finished.");
}

Man *man_new(void) {
	Man *man;
	man = g_object_new(MAN_TYPE, NULL);
	return man;
}

gchar* man_get_gob(Man *man)
{
    return man->job;
}
void  man_set_job(Man *man, gchar *job)
{
    man->job = job;
}

Man*  man_new_with_name_age_and_job(gchar *name, gint age, gchar *job)
{
    Man *man;
    man = man_new();
    BOY(man)->name = name;
    BOY(man)->age = age;
    man_set_job(man, job);
    return man;
}

static void man_bye(void)
{
    g_print("Goodbye everyone !\n");
}
void man_info(Man *man)
{
    g_print("the man name is %s\n", BOY(man)->name);
    g_print("the man age is %d\n", BOY(man)->age);
    g_print("the man job is %s\n", man->job);
}
